package student.gui;

import java.awt.Color;
import java.awt.Dimension;

import student.world.*;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JViewport;

public class MainWindow extends JFrame {

	private CritterWorld world;
	private WorldViewPanel worldView;
	private ControlPanel controls;
	private InformationPanel info;
	private JScrollPane worldPane;
	
	public MainWindow(CritterWorld w){
		setSize(1000, 600);
		world = w;
		Box mainBox = new Box(BoxLayout.X_AXIS);
		Box worldBox = new Box(BoxLayout.Y_AXIS);
		worldView = new WorldViewPanel(world);
		controls = new ControlPanel(world, worldView);
		info = new InformationPanel(world, worldView);
		add(mainBox);
		mainBox.add(worldBox);
		mainBox.add(controls);
		worldPane = new JScrollPane(worldView);
		worldBox.add(worldPane);
		worldBox.add(info);
		setVisible(true);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
	}
}
